<style>
.layui-input-block{
margin-left:120px;
}
</style>
<!-- start form -->
<form class="layui-form" action="" id="orderEditForm">

<div class="layui-row"  style="margin-top:10px;">
 <input type="hidden" class="layui-input" name="id" th:value="${staff.id}"lay-verify="required">
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">姓名：</label>
        <div class="layui-input-block" style="width:200px;">
            <input type="text" class="layui-input" name="name" th:value="${staff.name}" lay-verify="required">
        </div>
    </div>
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">用户角色：</label>
        <div class="layui-input-block" style="width:200px;">
            <select  name="roleId" id="roleId" lay-verify="required" >
                <option th:each="roleOne:${roleList}" th:value="${roleOne.id}" th:text="${roleOne.name}" th:selected="${roleOne.id}==${staff.roleId}"></option>
            </select>
        </div>
    </div>
    
    </div>
<div class="layui-row"  style="margin-top:10px;">
    
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">所属公司：</label>
        <div class="layui-input-block" style="width:200px;">
            <select  name="companyId" id="companyId" disabled>
            <option th:each="ec:${actCenterCompanyMap}" th:attr="value=${ec.id}" th:text="${ec.name}" th:selected="${staff.companyId}==${ec.id}">
<!--                 <option th:each="ec:${@redisHelper.getActCenterCompany(session.userCompanyId)}" th:value="${ec.id}" th:text="${ec.name}"></option> -->
            </select>
        </div>
    </div>
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">部门：</label>
        <div class="layui-input-block" style="width:200px;">
            <select  name="departmentId" id="departmentId" lay-verify="required">
            	<option th:each="ec:${dept}" th:attr="value=${ec.id}" th:text="${ec.name}" th:selected="${ec.id}==${staff.departmentId}">
            </select>
        </div>
    </div>
    
    </div>
<div class="layui-row"  style="margin-top:10px;">
    
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">员工编号：</label>
        <div class="layui-input-block" style="width:200px;">
            <input type="text" class="layui-input" name="no" th:value="${staff.no}" lay-verify="required">
        </div>
    </div>
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">联系电话：</label>
        <div class="layui-input-block" style="width:200px;">
            <input type="text" class="layui-input" name="phone" th:value="${staff.phone}" lay-verify="phone|required">
        </div>
    </div>
    
    </div>
<div class="layui-row"  style="margin-top:10px;">
    
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">邮箱：</label>
        <div class="layui-input-block" style="width:200px;">
            <input type="text" class="layui-input" name="email" th:value="${staff.email}" lay-verify="email|required">
        </div>
    </div>
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">职务：</label>
        <div class="layui-input-block" style="width:200px;">
         <input type="text" class="layui-input" name="post" th:value="${staff.post}" lay-verify="required">
<!--             <select name="status" > -->
<!--                 <option th:value="1">正常</option> -->
<!--                 <option th:value="0">停用</option> -->
<!--             </select> -->
        </div>
    </div>
    
    </div>
<div class="layui-row"  style="margin-top:10px;">
    
    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
        <label class="layui-form-label" style="width:120px;">备注：</label>
        <div class="layui-input-block" style="width:200px;">
            <textarea  class="layui-textarea"   style="min-height: 50px;" name="remark" th:text="${staff.remark}"></textarea>
        </div>
    </div>
    
</div>
<div class="layui-row" style="margin-top:20px;">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" style="text-align:center;">
          <button class="layui-btn" lay-submit="" lay-filter="formSubmit" authcode="900025">提交</button>
      	<button type="button" class="layui-btn layui-btn-primary" id="closeBtn">关闭</button>
    </div>
  </div>
</form>
<!-- end form -->
<script>
layui.use('form',function() {
	var form = layui.form;
	form.render();
	//表单提交监听
	form.on('submit(formSubmit)',function(data) {
		 $.ajax({url:'/com/staff/edit_execute',
				data:$("#orderEditForm").serializeJson(),
				type:"get",
				contentType:"application/json",
				success:function(data){
					if(data.code==200){
						layer.msg("数据保存成功！");
						reloadData();
						layer.closeAll();
					}else{
						layer.msg(data.message);
					}
				}});
			return false;
	});
	//关闭
	$("#closeBtn").click(function() {
		layer.closeAll();
	});
	function reloadData(){
		$(".layui-laypage-btn")[0].click();//页面的确定按钮
	}
});
</script>